package com.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 * @author Simon
 */
public class HibernateUtil {
    private static final SessionFactory FACTORY;

    static {
        Configuration configuration = new Configuration().configure("hibernate.cfg.xml");
        FACTORY = configuration.buildSessionFactory();
    }

    public static Session getSession() {
        return FACTORY.getCurrentSession();
    }
}